package util.math;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class IntervalCalc {
	
	List<Double> timeList;
	List<Double> intervalTimeList = new ArrayList<Double>();
	
	public IntervalCalc(List<Double> timeList) {
		this.timeList = timeList;
		Collections.sort(this.timeList);
	}
	
	public void setIntervalTimeList() {
		int size = timeList.size();
		double temp = timeList.get(0);
		
		for (int i = 1; i < size; i ++) {
			double interval = timeList.get(i) - temp;
			
			intervalTimeList.add(interval);
			temp = timeList.get(i);
		}
	}
	
	public List<Double> getIntervalTimeList() {
		return intervalTimeList;
	}

}
